package com.haredot.config;

import org.apache.solr.client.solrj.SolrClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.solr.core.SolrTemplate;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

@Configuration
public class SolrConfig {

    @Bean
    public SolrTemplate solrTemplate(@Nullable SolrClient solrClient) {
        Assert.notNull(solrClient, "solrClient 找不到");
        return new SolrTemplate(solrClient);
    }
}
